import { Get } from '../utils/http'

// /api/categoryFirst/list

/**
 * 获取一级分类列表
 */
export const getCategoryFirstApi = () =>
  Get({
    url: 'api/categoryFirst/list'
  })

/**
 * 获取二级分类列表
 */
export const getCategorySecondApi = () =>
  Get({
    url: 'api/categorySecond/listByFirstId'
  })

/**
 * 获取商品列表
 */
export const getGoodsListApi = (data = {}) =>
  Get({
    url: 'api/product/listByCategory',
    data
  })

/**
 * 获取商品详情
 */
export const getGoodsInfoApi = (data = {}) =>
  Get({
    url: 'api/product/detail',
    data
  })

/**
 * 收藏
 */
export const addCollectApi = (data = {}) =>
  Get({
    url: 'api/product/addCollect',
    data
  })

/**
 * 取消收藏
 */
export const cancelCollectApi = (data = {}) =>
  Get({
    url: 'api/product/cancelCollect',
    data
  })
